package employee;

import java.util.ArrayList;
import java.util.Scanner;
import static java.lang.Thread.sleep;
public class EmployeeMain {
    public static void main(String[] args) throws Exception {
        Scanner scanner = new Scanner(System.in);
        ArrayList<Employee> studentsList = new ArrayList<>();
        control:
        while (true) {
            System.out.println("===========欢迎来到员工信息管理系统===========");
            System.out.println("请选择您需要的功能");
            System.out.println("1-添加员工信息");
            System.out.println("2-删除员工信息");
            System.out.println("3-修改员工信息");
            System.out.println("4-查询员工信息");
            System.out.println("5-退出系统");
            System.out.println("请输入您需要运行的操作：");
            String choose = scanner.next();

            switch (choose) {
                case "1": {
                    System.out.println("===========添加员工信息功能===========");
                    System.out.println("请输入您要添加的员工的数量");
                    int Number = scanner.nextInt();

                    Employee.addStudent(studentsList, Number);
                    System.out.println("返回主菜单");
                    break;
                }
                case "2": {
                    System.out.println("===========删除员工信息功能===========");
                    System.out.println("请输入您要删除的员工的工号");
                    String SutdentNo = scanner.next();

                    Employee.removeStudent(studentsList, SutdentNo);
                    System.out.println("返回主菜单");
                    break;
                }
                case "3": {
                    System.out.println("===========修改员工信息功能===========");
                    System.out.println("请输入您要修改的员工的工号");
                    String StudentNo = scanner.next();

                    Employee.reSetStudent(studentsList, StudentNo);
                    System.out.println("返回主菜单");
                    break;
                }
                case "4": {
                    System.out.println("===========查询员工信息功能===========");
                    System.out.println("请输入您要查询的员工的工号");
                    String StudentNo = scanner.next();

                    Employee.checkStudent(studentsList, StudentNo);
                    sleep(2000);
                    System.out.println("返回主菜单");

                    break;
                }
                case "5": {
                    break control;
                }
                default: {
                    System.out.println("很抱歉，没有这个选项");
                }
            }
        }
    }

}